import { lazy } from 'react'
import { createBrowserRouter } from 'react-router-dom'
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
    TeamOutlined,
    UserOutlined,
} from '@ant-design/icons';

import Layout from '../pages/Layout/Index'
import Login from '../pages/Login/Index'
import Num from '../pages/404/Index'

const List = lazy(() => import('../pages/List/Index'))
const Data = lazy(() => import('../pages/Data/Index'))
const Root = lazy(() => import('../pages/Root/Index'))
const Home = lazy(() => import('../pages/Home/Index'))
const Yoot = lazy(() => import('../pages/Yoot/Index'))

const One = lazy(() => import('../pages/Home/One/Index'))

export const menu_router = [
    {
        path: '/list',
        element: <List></List>,
        title: "首页",
        icon: <DesktopOutlined />,
    },
    {
        path: '/data',
        element: <Data></Data>,
        title: "系统管理",
        icon: <FileOutlined />,

    },
    {
        path: '/root',
        element: <Root></Root>,
        title: "租户管理",
        icon: <PieChartOutlined />,

    },
    {
        path: '/home',
        element: <Home></Home>,
        title: "测试菜单",
        icon: <TeamOutlined />,

        children: [
            {
                path: '/home/one',
                element: <One></One>,
                title: "测试单表",
                icon: <UserOutlined />,

            },
        ]
    },
    {
        path: '/yoot',
        element: <Yoot></Yoot>,
        title: "系统监控",
        icon: <PieChartOutlined />,

    },

]
const router = createBrowserRouter([
    {
        path: '/',
        element: <Layout></Layout>,
        children: menu_router,
    },
    {
        path: '/Login',
        element: <Login></Login>,
    },
    {
        path: '*',
        element: <Num></Num>,
    },
])

export default router